<?php
require('config.php');

        $user_id=$_REQUEST['user_id'];
        $look_user_id=$_REQUEST['look_user_id'];
        $dengji=$_REQUEST['dengji'];
		$sql="select * from `".$oto."_distribution_log` where `cid`='{$look_user_id}' and level='{$dengji}' order by `time` DESC";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$log[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($log))
		{
			for($i=0;$i<count($log);$i++)
			{
				$orderId=$log[$i]['orderId'];
				$sql="select orderNo from `".$oto."_orders` where orderId='{$orderId}'";
				$result=$db->query($sql);
				while($row=$result->fetch_assoc()){
					$order[$i][]=$row;//将取得的所有数据赋值给person_info数组
				}
				if(isset($order[$i]))
				{
					$log[$i]['orderId']=$order[$i][0]['orderNo'];
				}
			}
		}
		echo json_encode($log);
?>